using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using BubzCommerce.CMS.Data.BusinessObjects;
using BubzCommerce.CMS.Data.Base;

namespace BubzCommerce.CMS.Data.ManagerObjects
{
    public partial interface ISiteconfigManager : IManagerBase<BubzCommerce.CMS.Data.BusinessObjects.Siteconfig, int>
    {
		// Get Methods
		Siteconfig GetByConfigCode(System.String configCode);
    }

    partial class SiteconfigManager : ManagerBase<BubzCommerce.CMS.Data.BusinessObjects.Siteconfig, int>, ISiteconfigManager
    {
		#region Constructors
		
		public SiteconfigManager() : base()
        {
        }
        public SiteconfigManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public Siteconfig GetByConfigCode(System.String configCode)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Siteconfig));
			
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("ConfigCode", configCode));
			
			IList<Siteconfig> result = criteria.List<Siteconfig>();
			return (result.Count > 0) ? result[0] : null;
        }
		
		#endregion
    }
}